import reqMethod from './api.config';
import config from '../config/index.js';

/**
 * 获取组的量表信息，续作
 * @param {json} params
 */
export const getMemoryInfoById = (params) =>
  reqMethod('get', `${config.host}/scale/master/health/v2022/getHealthInfoById`, params);

/**
 * 获取患者信息
 * @param {json} params
 */
export const getById = (params) =>
  reqMethod('get', `${config.host}/patient/info/getById`, params);

/**
 * 保存患者信息
 * @param {json} params
 * @returns
 */
export const savePatient = (params) =>
  reqMethod('post_json', `${config.host}/system/patient/savePatient`, params);

/**
 * 身份证上传
 * @param {json} params
 * @returns
 */
export const uploadBase64 = (params) =>
  reqMethod('post', `${config.host}/file/uploadBase64`, params);

/**
 * 获取身份证信息
 * @param {json} params
 * @returns
 */
export const getIdcardInfo = (params) =>
  reqMethod('get', `${config.host}/baidu/idcard/getIdcardInfo`, params);

/**
 * 主诉认知测评-SCE量表保存
 * @param {json} params
 * @returns
 */
export const sceSave = (params) =>
  reqMethod('post_json', `${config.host}/scale/sce/health/v2022/save`, params);

/**
 * 认知快速测评 (Mini-MMSE) 保存
 * @param {json} param
 * @returns {Promise}
 */
export const mmseSave = (params) =>
  reqMethod('post_json', `${config.host}/scale/miniMmse/health/v2022/save`, params);

/**
 * 记忆快速测评-EMT 保存
 * @param {json} params
 * @returns
 */
export const emtSave = (params) =>
  reqMethod('post_json', `${config.host}/scale/babriEmt/health/v2022/save`, params);

/**
 * 记忆门诊测评结束-更新完成状态
 * @param {json} param
 * @returns {Promise}
 */
export const updateFinishStatus = (params) =>
  reqMethod('post', `${config.host}/scale/master/health/v2022/updateFinishStatus`, params);

  /**
   * 更新中间状态
   * @param {json} param
   * @returns {Promise}
   */
  export const updateFinishStatusForScale = (params) =>
    reqMethod('post', `${config.host}/scale/master/health/v2022/updateFinishStatusForScale`, params);

/**
 * 测评估详情表列表信息
 * @param {json} param
 * @returns {Promise}
 */
export const getListByMasterId = (params) =>
  reqMethod('post_json', `${config.host}/scale/master/health/v2022/getHealthResultListByMasterIdAndGroupId`, params);

/**
 * 获取报告接口
 * @param {json} params
 * @returns
 */
export const getResult = (params) =>
  reqMethod('get', `${config.host}/scale/report/health/v2022/getResult`, params);

/**
* 获取报告接口-患者端
* @param {json} params
* @returns
*/
export const getResult2 = (params) =>
reqMethod('get', `${config.host}/scale/report/health/v2022/getResult`, params);

/**
* 发送邮箱
* @param {json} param
* @returns {Promise}
*/
export const sendMail = (params) =>
reqMethod('post', `${config.host}/scale/scaleMaster/sendMail`, params);

/**
 * 患者列表接口
 * @param {json} params
 * @returns
 */
export const queryPatient = (params) =>
  reqMethod('get', `${config.host}/doctor/patient/queryPatient`, params);

/**
 * 专项量表公共保存接口
 * @param {json} params
 * @returns
 */
export const testSave = (params) =>
  reqMethod('post_json', `${config.host}/scale/special/health/v2022/save`, params);

/**
 * 查询患者是否完成测评
 * @param {json} params
 * @returns
 */
export const getPatientScaleByIdCard = (params) =>
  reqMethod('get', `${config.host}/scale/master/health/v2022/getPatientScaleByIdCard`, params);

/**
 * 根据身份证查询患者
 * @param {json} params
 * @returns
 */
export const queryPatientByIdCard = (params) =>
  reqMethod('get', `${config.host}/system/patient/queryPatientByIdCard`, params);

/**
 * 调查问卷查询接口
 * @param {json} params
 * @returns
 */
export const awarenessGet = (params) =>
  reqMethod('get', `${config.host}/scale/question/v2022/getlast`, params);

/**
* 调查问卷保存接口
* @param {json} params
* @returns
*/
export const awarenessSave = (params) =>
	reqMethod('post_json', `${config.host}/scale/question/v2022/save`, params);

/**
 * 训练统计-患者列表
 * @param {json} params
 * @returns
 */
 export const trainPatientList = (params) =>
 reqMethod('post_json', `${config.host}/api/publicHealth/v1/beijing2022/trainPatientList`, params);

 /**
 * 训练统计-患者详情
 * @param {json} params
 * @returns
 */
export const trainPatientInfo = (masterId) =>
  reqMethod('get', `${config.host}/api/publicHealth/v1/beijing2022/trainPatientInfo?masterId=${masterId}`);

